<?php

/**
 * action filter form base class.
 *
 * @package    e-DSL
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseactionFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'wfmodele_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('wfmodele'), 'add_empty' => true)),
      'description'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ordre'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'etatorigine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatorigine'), 'add_empty' => true)),
      'etatdestine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatdestine'), 'add_empty' => true)),
      'role_acteur_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('role_acteur'), 'add_empty' => true)),
      'commentaire'            => new sfWidgetFormFilterInput(),
      'debutTraitement'        => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'finTraitement'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fermetechnique'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fermedemande'           => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'recalculedelai'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'readOnly'               => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'commentaireObligatoire' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'champsModifier'         => new sfWidgetFormFilterInput(),
      'icon'                   => new sfWidgetFormFilterInput(),
      'addAttach'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'sansmails'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'rolesNotification'      => new sfWidgetFormFilterInput(),
      'messageClient'          => new sfWidgetFormFilterInput(),
      'dossierAutomatique_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('dossierAutomatique'), 'add_empty' => true)),
      'messageUtilisateur'     => new sfWidgetFormFilterInput(),
      'created_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'wfmodele_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('wfmodele'), 'column' => 'id')),
      'description'            => new sfValidatorPass(array('required' => false)),
      'ordre'                  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'etatorigine_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('etatorigine'), 'column' => 'id')),
      'etatdestine_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('etatdestine'), 'column' => 'id')),
      'role_acteur_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('role_acteur'), 'column' => 'id')),
      'commentaire'            => new sfValidatorPass(array('required' => false)),
      'debutTraitement'        => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'finTraitement'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fermetechnique'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fermedemande'           => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'recalculedelai'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'readOnly'               => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'commentaireObligatoire' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'champsModifier'         => new sfValidatorPass(array('required' => false)),
      'icon'                   => new sfValidatorPass(array('required' => false)),
      'addAttach'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'sansmails'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'rolesNotification'      => new sfValidatorPass(array('required' => false)),
      'messageClient'          => new sfValidatorPass(array('required' => false)),
      'dossierAutomatique_id'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('dossierAutomatique'), 'column' => 'id')),
      'messageUtilisateur'     => new sfValidatorPass(array('required' => false)),
      'created_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('action_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'action';
  }

  public function getFields()
  {
    return array(
      'id'                     => 'Number',
      'wfmodele_id'            => 'ForeignKey',
      'description'            => 'Text',
      'ordre'                  => 'Number',
      'etatorigine_id'         => 'ForeignKey',
      'etatdestine_id'         => 'ForeignKey',
      'role_acteur_id'         => 'ForeignKey',
      'commentaire'            => 'Text',
      'debutTraitement'        => 'Boolean',
      'finTraitement'          => 'Boolean',
      'fermetechnique'         => 'Boolean',
      'fermedemande'           => 'Boolean',
      'recalculedelai'         => 'Boolean',
      'readOnly'               => 'Boolean',
      'commentaireObligatoire' => 'Boolean',
      'champsModifier'         => 'Text',
      'icon'                   => 'Text',
      'addAttach'              => 'Boolean',
      'sansmails'              => 'Boolean',
      'rolesNotification'      => 'Text',
      'messageClient'          => 'Text',
      'dossierAutomatique_id'  => 'ForeignKey',
      'messageUtilisateur'     => 'Text',
      'created_at'             => 'Date',
      'updated_at'             => 'Date',
    );
  }
}
